class Solution
{
public:
    int returnToBoundaryCount(vector<int> &nums)
    {
        int cur = 0;
        int result = 0;
        for (int num : nums)
        {
            cur += num;
            if (cur == 0)
            {
                ++result;
            }
        }
        return result;
    }
};